package com.jeff.springbootdemo.controller;

import com.jeff.springbootdemo.bean.Bus;
import com.jeff.springbootdemo.bean.Car;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Slf4j
@Controller
public class MainController {

    @ResponseBody
    @RequestMapping("/getMainIndex")
    public String getMainIndex(){
        return "{}";
    }


    @Autowired
    private Car car;

    @ResponseBody
    @RequestMapping("/getCar")
    public Car getCar(){
        return car;
    }

    @Autowired
    Bus bus;

    @ResponseBody
    @RequestMapping("/getBus")
    public Bus getBus(){
        log.info("请求进来");
        return bus;
    }


    @ResponseBody
    @RequestMapping("/jt2.jpg")
    public String jt1(){
        return "jt2";
    }

}
